{% extends '::base.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<style>
		label, input.text { display:block; }
		input.text { margin-bottom:12px; width:25%; padding: .4em; }
		
</style>
{% endblock %}
{% block body %}
<div id="accordion">
   <h1> Добавление товара</h1>
   
    
             <h2>Основные данные </h2>
                <div class="left_box">
                        <form action="{{ path('_add_staff', {'firm_id': firm_id, 'staff_id': staff_id}) }}" method="POST" id="contact_form" {{ form_enctype(form) }} >
                            {{ form_label(form.name) }}
                            {{ form_widget(form.name, {'attr': {'class': 'text' } }) }}
                            {{ form_label(form.description) }}
                            {{ form_widget(form.description, {'attr': {'class': 'tinymce', 'tinymce':'{"theme":"simple"}' } }) }}
                            {{ form_label(form.category) }}
                            {{ form_widget(form.category, {'attr': {'class': 'text'  } }) }}
                            <input id="add_category" type="button" value="Добавить Категорию"/>
                            {{ form_row(form.file) }}
                            {{ form_rest(form) }}</br>
                            <input type="submit" value="Сохранить"/>
                        </form>
                 </div>
</div>
{% endblock %}
{% block post_init_javascript %}
{{ parent() }}
$('input:submit').button();
$('input:button#add_category').button()
                              .click(function(){
                                 $('<input type="text" class="text" name="category"/>').replaceAll('select.text');
                                 $(this).remove();
                              });
{% endblock %}
                              
{% block post_javascripts %}
  {{ parent() }}
  {{ tinymce_init() }}
{% endblock %}
